<template>
  <div>
    <input type="text" v-model="user.id" />
    <input type="text" v-model="user.name" />
    <button @click="handleSubmit">提交</button>
    <ul>
      <li v-for="(item, index) in o.arr" :key="item.id" @click="handleDel(index)">{{ item.name }}</li>
    </ul>
  </div>
</template>
<script>
// Hook
import { useDel, useAdd } from './hooks'
export default {
  setup() {
    const { o, handleDel } = useDel()
    const { user, handleSubmit } = useAdd(o)
    return {
      o,
      handleDel,
      user,
      handleSubmit,
    }
  },
}
</script>
